/*
  Copyright (c) 2020 classmate-sun
  [Software Name] is licensed under Mulan PSL v2.
  You can use this software according to the terms and conditions of the Mulan PSL v2.
  You may obtain a copy of Mulan PSL v2 at:
          http://license.coscl.org.cn/MulanPSL2
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  See the Mulan PSL v2 for more details.
*/

import Vue from 'vue'
import VueRouter from 'vue-router'
import adminWork from '../views/adminWork/adminWork'
import writeBlogOld from "../views/adminWork/writeBlogOld";
import Music from "../components/Music";
import classify from "../views/classify/classify";
import musicManagement from "../views/adminWork/musicManagement";
import diaryManagement from "@/views/adminWork/diaryManagement";
import linkManagement from "@/views/adminWork/linkManagement";
import playManagement from "@/views/adminWork/playManagement";
Vue.use(VueRouter)


const router = new VueRouter({
  mode: 'hash',
  routes:[
    {
      path: '/',
      name: 'Home',
      component: () => import('../views/Home')
    },
    {
      path: '/about',
      name: 'About',
      component: () => import('../views/About')
    },
    {
      path: '/Music',
      name: 'Music',
      component: () => import('../components/Music')
    },
    {
      path: '/blog/:id',
      name: 'Blog',
      component: () => import('../views/Blog')
    },
    {
      path: '/message',
      name: 'Message',
      component: () => import('../views/Message')
    },
    {
      path: '/game',
      name: 'game',
      component: () => import('../views/Game/index')
    },
    {
      path: '/play/扫雷',
      name: 'Play',
      component: () => import('../views/Play/扫雷.vue')
    },
    {
      path: '/play/圈猫猫',
      name: 'Play',
      component: () => import('../views/Play/cat.vue')
    },
    {
      path: '/play/俄罗斯方块',
      name: 'Play',
      component: () => import('../views/Play/tetris.vue')
    },
    {
      path: '/play/五子棋',
      name: 'Play',
      component: () => import('../views/Play/Gobang.vue')
    },
    {
      path: '/play/在线五子棋',
      name: 'Play',
      component: () => import('../views/Play/GobangHall.vue')
    },
    {
      path: '/play/GoBangOnline',
      name: 'Play',
      component: () => import('../views/Play/GobangOnline.vue')
    },
    {
      path: '/video',
      name: 'Video',
      component: () => import('../views/Vid')
    },
    {
      path: '/watch/:id',
      name: 'Video',
      component: () => import('../views/watch')
    },
    {
      path: '/diary',
      name: 'Diary',
      component: () => import('../views/Diary')
    },
    {
      path: '/links',
      name: 'Links',
      component: () => import('../views/Links')
    },
    {
      path: '/Article/:id',
      name: 'Article',
      component: () => import('../views/Article')
    },
    {
      path: '/user/:id',
      name: 'About',
      component: () => import('../views/user')
    },
    {
      path:'/adminLogin',
      name:'adminLogin',
      component:()=>import('../views/adminWork/adminLogin.vue')
    },
    {
      path: '/adminWork',
      component: adminWork,
      // meta: {
      // requireAdmin: true,//false为不登陆也可看，true为登录才可看
      // },
      children: [
        {
          path: 'writeBlogOld',
          component: writeBlogOld,
          // meta: {
          //    requireAdmin: true,//false为不登陆也可看，true为登录才可看
          // },
        },
        {
          path: 'classify',
          component: classify,
          // meta: {
          //    requireAdmin: true,//false为不登陆也可看，true为登录才可看
          // },
        },
        {
          path: 'musicManagement',
          component: musicManagement,
        },
        {
          path: 'diaryManagement',
          component: diaryManagement,
        },
        {
          path:'linkManagement',
          component: linkManagement,
        },
        {
          path:'playManagement',
          component: playManagement,
        },
      ]
    },
    {
      path:'/writeBlog',
      name:'WriteBlog',
      component:()=>import('../views/writeBlog/index')
    },

    {
      path: '*',
      name: 'NotFound',
      component: () => import('../views/404')
    }
  ]
})

export default router
